<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>v-model修饰符的使用</title>
  </head>
  <body>
    <div id="app">
      <!-- 第一个修饰符：lazy -->
      <input type="text" v-model.lazy="message" />
      <h2>{{message}}</h2>
      <!-- 第二个修饰符：number -->
      <input type="number" v-model.number="age" />
      <h2>{{age}} - {{typeof age}}</h2>
      <!-- 3.trim 删除左右两边的空格 -->
      <input type="text" v-model.trim="name" />
      <h2>您输入的姓名是:{{name}}</h2>
    </div>
    <script src="../vue.js"></script>
    <script>
      const app = new Vue({
        el: "#app",
        data: {
          message: "hello",
          age: 0,
          name: "",
        },
      });
    </script>
  </body>
</html>
